
close
NUM_10000 = 0.201788 .* [ 1.000000 2.000000 1.000000 ]; DENO_10000 = [1.000000 -0.391672  0.198823 ];
NUM_5000  = 0.077806 .* [ 1.000000 2.000000 1.000000 ]; DENO_5000  = [1.000000 -1.070930  0.382156 ];
NUM_1000  = 0.004589 .* [ 1.000000 2.000000 1.000000 ]; DENO_1000  = [1.000000 -1.799433  0.817790 ];

[H_1000, W1]  = freqz(NUM_1000, DENO_1000);
[H_5000, W2]  = freqz(NUM_5000, DENO_5000);
[H_10000, W3] = freqz(NUM_10000, DENO_10000);

f_1 =W1.*44100/(2*pi);
f_2 =W2.*44100/(2*pi);
f_3 =W3.*44100/(2*pi);

gr=semilogx(f_1, abs(H_1000),'-r',f_2,abs(H_5000),'-b',f_3,abs(H_10000),'-g');
set (gr(1), "linewidth", 2)
set (gr(2), "linewidth", 2)
set (gr(3), "linewidth", 2)
legend("1000 Hz","5000 Hz","10 000 Hz");
title("Respuesta del filtro IIR",'FontSize',20)
xlabel("Frecuencia (Hz)",'FontSize',14)
ylabel("|H(z)|",'FontSize',14)
print -deps iir_graf_diff_freq.eps -color


